<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <title></title>
    <link rel="stylesheet" href="__PUBLIC__/wap/css/upgrade_goods.css" type="text/css"/>
</head>
<body>
<div class="member_content margin_center bgcolor_f3">
    <img src="__PUBLIC__/wap/img/upgrade_goods_01.png" alt="会员升级" title="会员升级"/>
</div>
<div class="vip member_content margin_center">
    <a href="{:U('wap/upgrade/vip_tq')}">
        <img src="__PUBLIC__/wap/img/upgrade_goods_04.png" alt="会员升级" title="会员升级"/>
    </a>
</div>
<div class="member_content margin_center bgcolor_f3 more_html">
    <volist name="list" id="vo">
        <img src="__ROOT__{$vo.goods_img}" alt="会员商品" title="会员商品"/>
        <div class="product_information bgcolor_white border_bottom">
            <p class="padding5">{$vo.goods_name}</p>

            <div class="product_dat padding5 ">
                <i class="color_eb float_left">￥{$vo.shop_price}</i>
                <span class="float_right margin_right10">
                    <a href="{:U('wap/goods/goods_detail',array('id'=>$vo['goods_id']))}" style="color: #fff;">我要升级VIP</a>
                </span>
            </div>
        </div>
    </volist>
</div>
<div class="b_q get_more_html member_content margin_center" style="display:none;margin-bottom: 0px;">
    <div class="fm-footer-copyright get_more" style="text-align: center;">
        <if condition="$count gt 6 && count($list) eq 6">
            加载更多
            <else/>
            无更多数据
        </if>
    </div>
</div>
<!--
<div style="height: 50px;"></div>
<div class="member_content margin_center records">
    <div class="records_det">
        <img src="imgs/会员升级_14.png" alt="领取礼品" title="领取礼品">
        <p>坚果干果礼盒 零食特产 春节年货 大礼包企业员工福利1440g</p>
        <label>14:51</label>
    </div>
</div>-->
<input type="hidden" name="p" data="2" value="2"/>
<include file="Public/wap_javascript"/>
<script>
    var load_more = 0;
    var load_none = 0;
    $(function () {
        $(window).scroll(function () {
            var scrollTop = $(this).scrollTop();
            var scrollHeight = $(document).height();
            var windowHeight = $(this).height();
            if (scrollTop + windowHeight == scrollHeight) {
                $('.get_more_html').show();
                //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
                if (load_none != 1) {
                    if (load_more == 1) {
                        var html = ' <img src="__PUBLIC__/wap/img/icon_zhuan.gif" style="max-width:15px;">';
                        $('.get_more').html('加载中' + html);
                    } else {
                        get_more();
                    }
                }
            }
        });
    })
    function get_more() {
        load_more = 1;
        var html = ' <img src="__PUBLIC__/wap/img/icon_zhuan.gif" style="max-width:15px;">'
        $('.get_more').html('加载中' + html);
        // var p=$("input[name='p']").val();
        var p = $("input[name='p']").attr('data');
        $.ajax({
            url: "{:U('wap/upgrade/upgrade_goods')}",
            type: 'get',
            data: {p: p},
            dataType: 'json',
            success: function (data) {
                //console.log(data);
                var con = 1;
                var option = '';
                if (data) {
                    $.each(data, function (i) {
                        //this指向当前元素
                        //i表示Array当前下标
                        //value表示Array当前元素
                        option = option + ' <img src="__ROOT__'+this.goods_img+'" alt="会员商品" title="会员商品"/>'
                                +'<div class="product_information bgcolor_white border_bottom">'
                                +'<p class="padding5">'+ this.goods_name+'</p>'
                                +'<div class="product_dat padding5 ">'
                                +'<i class="color_eb float_left">￥'+ this.shop_price+'</i>'
                                +'<span class="float_right margin_right10">'
                                +'<a href="{:U("wap/goods/goods_detail")}?id='+this.goods_id+'" style="color: #fff;">我要升级VIP</a>'
                                +'</span></div></div>';
                        con++;
                    });
                }
                $('.more_html').append(option);
                load_more = 0;
                if (option) {
                    // $("input[name='p']").val(parseInt(p)+1);
                    $("input[name='p']").attr('data', parseInt(p) + 1);
                }
                if (con < 6) {
                    load_none = 1;
                    $('.get_more').html('无更多数据');
                }
            }
        });
    }
</script>
</body>
</html>